package com.gnerv.sylvanas.business.manage.storage;

import com.gnerv.sylvanas.business.manage.model.dto.ApiGroupDTO;
import com.gnerv.sylvanas.business.manage.model.dto.ApiGroupTreeDTO;
import com.gnerv.sylvanas.business.manage.model.dto.ApiGroupTreeDetailsDTO;
import com.gnerv.sylvanas.business.manage.model.entity.ApiGroup;
import com.gnerv.sylvanas.business.manage.repository.mapper.ApiGroupMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Gnerv LiGen
 */
@Slf4j
@Service
@AllArgsConstructor
public class ApiGroupStorageService {

    private final ApiGroupMapper apiGroupMapper;

    
    public int insert(ApiGroup apiGroup) {
        return apiGroupMapper.insert(apiGroup);
    }

    
    public int deleteByUkId(String ukId) {
        return apiGroupMapper.deleteByUkId(ukId);
    }

    
    public int updateByUkId(ApiGroup apiGroup) {
        return apiGroupMapper.updateByUkId(apiGroup);
    }

    
    public ApiGroupDTO selectByUkId(String ukId) {
        return apiGroupMapper.selectByUkId(ukId);
    }

    
    public List<ApiGroupDTO> selectListByName(String name, int limitStart, int limitSize) {
        return apiGroupMapper.selectListByName(name, limitStart, limitSize);
    }

    
    public int selectCountByName(String name) {
        return apiGroupMapper.selectCountByName(name);
    }

    
    public List<ApiGroupTreeDTO> selectListTreeByParentUkId(String parentUkId) {
        return apiGroupMapper.selectListTreeByParentUkId(parentUkId);
    }

    
    public List<ApiGroupTreeDetailsDTO> selectListTreeDetailsByParentUkId(String parentUkId) {
        return apiGroupMapper.selectListTreeDetailsByParentUkId(parentUkId);
    }

}
